/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package view.tabbedpane;

import java.awt.Color;
import java.util.Observable;
import java.util.Observer;

import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;

import view.invoice.InvoiceAddPanel;
import view.invoice.InvoiceViewPanel;

public class InvoiceTabbedPane extends JPanel {

	private static final long serialVersionUID = 1L;
	
	public InvoiceTabbedPane() {
		initComponents();
		
		this.pn_invoiceadd_main.getController().addObserver(this.pn_invoiceview_main.getController());
	}
	public Observer getObserver(){
		return pn_invoiceadd_main.getController();
	}
	
	public Observable getObservable(){
		return pn_invoiceadd_main.getController();
	}

	private void initComponents() {

		tabPaneInv = new JTabbedPane();
		pn_invoiceview_main = new InvoiceViewPanel();
		pn_invoiceadd_main = new InvoiceAddPanel();
		
		pn_invoiceview_main.setBackground(Color.WHITE);
		pn_invoiceadd_main.setBackground(Color.WHITE);
		pn_invoiceview_main.setBounds(0, 0, 906, 480);
		pn_invoiceadd_main.setBounds(0, 0, 906, 480);
		
		setForeground(new java.awt.Color(255, 255, 255));

		tabPaneInv.addTab("View Invoice", pn_invoiceview_main);
		tabPaneInv.addTab("Add Invoice", pn_invoiceadd_main);

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addComponent(tabPaneInv));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addComponent(tabPaneInv));
	}

	private InvoiceViewPanel pn_invoiceview_main;
	private InvoiceAddPanel pn_invoiceadd_main;
	private JTabbedPane tabPaneInv;

}
